<template>
  <div class="app-container">
    <el-form
      :inline="true"
      :model="formInline"
      label-suffix="："
      class="demo-form-inline"
      label-width="100px"
      label-position="right"
    >
      <el-form-item label="商品名称">
        <el-input v-model="formInline.user" placeholder="商品名称" />
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          size="small"
          @click="onSubmit"
        >查询</el-button>
        <el-button size="small" @click="onSubmit">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table
      v-loading="listLoading"
      :data="tableData"
      border
      fit
      :header-cell-style="{
        textAlign: 'center',
        color: '#909399',
        backgroundColor: '#f8f8f8',
      }"
    >
      <el-table-column label="ID" prop="id" align="center" />
      <el-table-column
        label="商品名称"
        prop="goods_name"
        align="center"
      />
      <el-table-column
        label="商品价格"
        prop="goods_price"
        align="center"
      />
      <el-table-column
        label="优惠金额"
        prop="DiscountAmount"
        align="center"
      />
      <el-table-column
        label="上架时间"
        prop="listing_time"
        align="center"
      />
      <el-table-column
        label="上下架状态"
        prop="goods_status"
        align="center"
      />
      <el-table-column label="操作" prop="handle" align="center">
        <template>
          <el-button type="primary" size="small">上架</el-button>
          <el-button size="small">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="formInline.total > 0"
      :total="formInline.total"
      :page.sync="tableData.page"
      :limit.sync="tableData.limit"
      @pagination="getList"
    />
  </div>
</template>

<script>
import Pagination from "@/components/Pagination";
export default {
  components: { Pagination },
  data() {
    return {
      listLoading: false,
      formInline: {
        total: 10,
        page: 1,
        limit: 10,
      },
      tableData: [
        {
          id: 1,
          goods_name: "商品名称",
          goods_price: "123.22",
          DiscountAmount: "5.00",
          listing_time: "2023-12-02 15:27:22",
        },
      ],
    };
  },
};
</script>

<style></style>
